home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Unreal Tournament Game Programming for Teens
/
UnrealTournamentGameProgrammingForTeens.iso
/
Chapter Files
/
Chapter09
/
DiscoBall.txt
next >
Wrap
Text File
|
2006-11-01
|
717b
|
30 lines
//=============================================================================
// DiscoBall.
//=============================================================================
class DiscoBall extends KActor placeable;
function PreBeginPlay() {
// # 1
// Sets the timer to go off every 9 seconds
// The 'true' arguement means call the Timer function each time the timer
// goes off, not just the first time.
SetTimer(9.0, true);
}
function PostBeginPlay() {
// # 2
// Sets the initial velocity vector to point down and sets the speed to 30
Velocity = vect(0,0,-90);
}
function Timer() {
// # 3
// Multipy by -1 each time the executes
Velocity = (-1) * Velocity;
}